global $wgNamespaceProtection;
if ( isset( $wgNamespaceProtection[$this->mNamespace] ) ) {
+ $permissionManager = MediaWikiServices::getInstance()->getPermissionManager();
foreach ( (array)$wgNamespaceProtection[$this->mNamespace] as $right ) {
- if ( $right != '' && !$user->isAllowed( $right ) ) {
+ if ( !$permissionManager->userHasRight( $user, $right ) ) {
return true;
}
}
return [ [ 'badtitletext' ] ];
}
- $mp = new MovePage( $this, $nt );
+ $mp = MediaWikiServices::getInstance()->getMovePageFactory()->newMovePage( $this, $nt );
$errors = $mp->isValidMove()->getErrorsArray();
if ( $auth ) {
$errors = wfMergeErrorArrays(
global $wgUser;
- $mp = new MovePage( $this, $nt );
+ $mp = MediaWikiServices::getInstance()->getMovePageFactory()->newMovePage( $this, $nt );
$method = $auth ? 'moveIfAllowed' : 'move';
$status = $mp->$method( $wgUser, $reason, $createRedirect, $changeTags );
if ( $status->isOK() ) {